<template>
    <section class="page">
        <PageTabbar :tabbar="tabbar"></PageTabbar>
        <home v-show="tabbar == 'home'" :isCurrentPage="tabbar == 'home'"></home>
        <center v-show="tabbar == 'center'" :isCurrentPage="tabbar == 'center'"></center>
        <my v-if="tabbar == 'my'" :isCurrentPage="tabbar == 'my'"></my>
    </section>
</template>

<script>
import PageTabbar from '@/components/layout/PageTabbar.vue'
import home from './home/index.vue'
import center from './center/index.vue'
import my from './my/index.vue'
export default {
    name: 'index',
    components: { PageTabbar, home, center, my },
    data () {
        return {
            tabbar: "home"
        }
    },
    activated () {
        this.tabbar = this.$route.params.tab || 'home'
    },
    created () {
    },
    methods: {
    },
    watch: {
        '$route' (to, from) {
            if (to.params.tab) {
                this.tabbar = to.params.tab || 'home'
            }
        }
    }
}
</script>

<style lang="less" scoped>
</style>
